package com.wfs.spring;

import com.wfs.spring.conditiona.MagicBean;
import com.wfs.spring.config.SpringConfig;
import com.wfs.spring.service.TestThreeService;
import com.wfs.spring.service.TestTwoService;
import com.wfs.spring.service.aop.TestAopService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.util.List;
import java.util.ArrayList;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {SpringConfig.class})
@ActiveProfiles("prod")
public class SpringTest {
    @Value("${name}")
    public String name;

    @Autowired
    TestTwoService testTwoService;
    @Autowired
    TestThreeService testThreeService;
    @Autowired(required = false)
    MagicBean magicBean;
    @Autowired
    TestAopService testAopService;


    @Test
    public void test1(){
        int i=0;
      /*  System.out.println(magicBean);
        testTwoService.testTwo();
        System.out.println(this.name);*/
       // testThreeService.test3();
      //  testAopService.testAop("aop");
      /*  testAopService.testAop("wwwwww");
      Encoreable encoreable=  (Encoreable)testAopService;
      ((Encoreable) testAopService).performEncor();*/
      List<String> list=new ArrayList<String>();
      list.add("-1");
      list.add("1");
        list.add("2");
        list.add("-2");
        list.add("01");
        list.add("+20190809-12");
      list.add("+20190808-123");
      list.add("+20190809-13");

      list.sort(Comparable::compareTo);
        for (String s : list) {
            System.out.println(s);
        }

    }
}
